package com.tedu.egweibo1.pojo.dto;

import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.NonNull;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.Pattern;

@Data
public class UserRegDTO {
    @NotBlank
    @Pattern(regexp = "^[\\u4e00-\\u9fa5]{3,30}|[A-Za-z0-9_]{3,30}$",message = "用户名只能是中文或者数字_,且长度只能在1-30之间")
    @ApiModelProperty(value = "用户名", required = true,example = "张三")
    private String username;
    @NotBlank
    @Pattern(regexp = "^[a-zA-Z0-9_]{6,30}$",message = "密码只能是英文数字_,且长度在6-30之间")
    @ApiModelProperty(value = "密码",required = true,example = "123456")
    private String password;
    @NotBlank
    @Pattern(regexp = "^([\\u4e00-\\u9fa5]|[A-Za-z0-9_]){4,30}$",message = "昵称只能是中文或者数字_,且长度只能在1-30之间")
    @ApiModelProperty(value = "昵称", required = true,example = "三呀")
    private String nickname;
}
